package controller

import (
	"CSMS/conteoller/mapping"
	"github.com/gin-gonic/gin"
)

func Controller(r *gin.Engine) *gin.Engine {
	//主页面
	r.GET("/", mapping.IndexGET)
	login := r.Group("/login")
	{
		login.POST("", mapping.LoginPOST)
	}
	//操作中心
	operateCenter := r.Group("/operateCenter")
	{
		operateCenter.GET("", mapping.OperateCenterGET)
		//获取订货页面
		operateCenter.GET("Indent", mapping.OrderGoodsGET)
		//生成订单
		operateCenter.POST("submitOrder",mapping.UpdateIndentPOST)
		//获取订单页面
		operateCenter.GET("queryIndent",mapping.QueryIndentGET)
		//获取送货清单页面
		operateCenter.GET("deliveryInventory",mapping.DeliveryInventoryGET)
		//获取财务清单页面
		operateCenter.GET("financeInventory",mapping.FinanceInventoryGET)
		//获取每月用户统计页面
		operateCenter.GET("nowMonthUser",mapping.NowMonthUserGET)
	}

	//获取商品表信息
	r.GET("/goodListGET", mapping.GoodListGET)
	//获取订单表信息
	r.POST("/indentListGET",mapping.IndentListGET)
	//获取订单信息
	r.POST("/indentDetail",mapping.IndentDetailGET)
	//获取订单-商品(送货)信息
	r.POST("/todayDeliveryList",mapping.TodayDeliveryListGET)
	//获取打折表信息
	r.GET("/discountListGET",mapping.DiscountListGET)
	//获取财务清单信息
	r.GET("/financeInfoGET",mapping.FinanceInfoGET)
	//获取当月用户信息
	r.GET("/nowMonthUserInfoGET",mapping.NowMonthUserInfoGET)
	return r
}
